<script setup lang='ts'>
import { editGrowthColumns, editIntegralColumns, formType } from '../list'

const props = defineProps(['type', 'editfrom', 'loading'])
const emits = defineEmits(['close', 'submit'])
const { editfrom, loading, type } = toRefs(props)
console.log('🚀 ~ editFrom:', editfrom?.value)
const formColums = computed(() => {
    if (type?.value === formType.integral)
        return editIntegralColumns

    return editGrowthColumns
})
</script>

<template>
    <div>
        <PlusForm v-model="editfrom"
                  label-position="top"
                  :row-props="{ gutter: 20 }"
                  :columns="formColums"
        >
            <template #footer>
                <div>
                    <el-button @click="emits('close')">
                        取消
                    </el-button>

                    <el-button type="primary"
                               :loading="loading"
                               @click="emits('submit')"
                    >
                        确认
                    </el-button>
                </div>
            </template>
        </PlusForm>
    </div>
</template>
